<html>
<head>
<meta charset="gbk">
</head>
<body>
	<h2>test</h2>
	<input type="text" value="6cr1Fybe3f9SGa+zFNFUylHCBxihay4NfTAOu5HmhM9vSf3JLpDSeVgTFnLvKZSU" size=100 id="normal"></input><br>
	<input type="button" value="encode" onclick="encode()"></input>
	<input type="button" value="decode" onclick="decode()"></input>
	<div id="msg"></div>
        <!-- CryptoJS -->
        <script src="src/core.js"></script>
        <script src="src/lib-typedarrays.js"></script>
        <script src="src/x64-core.js"></script>
        <script src="src/enc-utf16.js"></script>
        <script src="src/enc-base64.js"></script>
        <script src="src/md5.js"></script>
        <script src="src/sha1.js"></script>
        <script src="src/sha256.js"></script>
        <script src="src/sha224.js"></script>
        <script src="src/sha512.js"></script>
        <script src="src/sha384.js"></script>
        <script src="src/sha3.js"></script>
        <script src="src/ripemd160.js"></script>
        <script src="src/hmac.js"></script>
        <script src="src/pbkdf2.js"></script>
        <script src="src/evpkdf.js"></script>
        <script src="src/cipher-core.js"></script>
        <script src="src/mode-cfb.js"></script>
        <script src="src/mode-ctr.js"></script>
        <script src="src/mode-ofb.js"></script>
        <script src="src/mode-ecb.js"></script>
        <script src="src/pad-ansix923.js"></script>
        <script src="src/pad-iso10126.js"></script>
        <script src="src/pad-zeropadding.js"></script>
        <script src="src/pad-iso97971.js"></script>
        <script src="src/pad-nopadding.js"></script>
        <script src="src/rc4.js"></script>
        <script src="src/rabbit.js"></script>
        <script src="src/rabbit-legacy.js"></script>
        <script src="src/aes.js"></script>
        <script src="src/tripledes.js"></script>
		<script type="text/javascript" src="entry/js/base64.js"></script>
	<script>
		// {"keyWord":"","uID":41}
		var key = CryptoJS.enc.Utf8.parse("sdfgyuiedfoiu64d"); 
		
		function encode()
		{
			var b = document.getElementById('normal').value;
			var b64 = CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(b));
			document.getElementById('msg').innerHTML = b64;
			var en = Encrypt(b64);
			document.getElementById('msg').innerHTML += '<br>';
			document.getElementById('msg').innerHTML += en;
		}
		function decode()
		{
			var dec = Decrypt(document.getElementById('normal').value);
			document.getElementById('msg').innerHTML = dec;
			document.getElementById('msg').innerHTML += "<br>";
			document.getElementById('msg').innerHTML += Base64Decode(dec);
		}
		function Encrypt(word){ 
		         var srcs = CryptoJS.enc.Utf8.parse(word);  
		         var encrypted = CryptoJS.AES.encrypt(srcs, key, {mode:CryptoJS.mode.ECB,padding: CryptoJS.pad.Pkcs7});  
		         return encrypted.toString();  
		    }  
		    function Decrypt(word){  		          
		         var decrypt = CryptoJS.AES.decrypt(word, key, {mode:CryptoJS.mode.ECB,padding: CryptoJS.pad.Pkcs7});  
		         return CryptoJS.enc.Utf8.stringify(decrypt).toString();  
		 }  
		function Base64Encode(str)
		 {
			 // return CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(str)).toString(CryptoJS.enc.Utf8);
			 return Base64II.encode(str);
		 }
		function Base64Decode(str)
		 {
		 	return Base64II.decode(str);
			 // return CryptoJS.enc.Base64.parse(str).toString(CryptoJS.enc.Utf8);
		 }
		 
	window.onload=function(){
		
	}
	</script>
</body>
</html>
